import articleApi from "@/api/articleApi";
export async function fetchArticleList(id = getSearchParam("id")) {
  let imei = LocalStorage.getItem("imei");
  let searchParams1 = {
    publisherId: "Vilykke",
    key: "c9332c3480a2abaa8ee2b2be8d1f4c58",
    language: "en",
    countryCode: "IN",
    imei: imei,
    // category: "Hot",
    category: getSearchParam("category") ?? "Hot",
    test: getSearchParam("test"),
  };
  let searchParams2 = {
    publisherId: "Vilykke",
    key: "c9332c3480a2abaa8ee2b2be8d1f4c58",
    language: "en",
    countryCode: "IN",
    imei: imei,
    // category: "Hot",
    category: getSearchParam("category") ?? "Hot",
    id: id, // 点击更多传的新闻id
    test: getSearchParam("test"),
  };
  let searchParams = id ? searchParams2 : searchParams1;
  let resData = await articleApi.queryArticleList(searchParams);
  return resData;
}
